<template><div><h2 id="数据详情初始化" tabindex="-1"><a class="header-anchor" href="#数据详情初始化"><span>数据详情初始化</span></a></h2>
<p>通过<code v-pre>Show::resolving</code>方法设置的回调函数会在<code v-pre>Dcat\Admin\Show</code>类被实例化时触发；</p>
<p>通过<code v-pre>Show::composing</code>方法设置的回调函数会在<code v-pre>render()</code>方法被调用时触发；</p>
<p>开发者可以在这两个事件中改变<code v-pre>Show</code>的一些设置或行为，比如需要禁用掉某些操作，可以在<code v-pre>app/Admin/bootstrap.php</code>加入下面的代码：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token keyword">use</span> <span class="token package">Dcat<span class="token punctuation">\</span>Admin<span class="token punctuation">\</span>Show</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token class-name static-context">Show</span><span class="token operator">::</span><span class="token function">resolving</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token class-name type-declaration">Show</span> <span class="token variable">$show</span><span class="token punctuation">)</span> <span class="token punctuation">{</span></span>
<span class="line"></span>
<span class="line">     <span class="token variable">$show</span><span class="token operator">-></span><span class="token function">showQuickEdit</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>本文章首发在 <a href="https://learnku.com/" target="_blank" rel="noopener noreferrer">LearnKu.com</a> 网站上。</p>
</div></template>


